﻿using Bogus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;

namespace android_charge.Utils
{
    internal class UKAdd
    {
        public static string[] adds = new string[] {
            "10 Downing Street|Westminster London|SW1A 2AA",
            "221B Baker Street|Marylebone London|NW1 6XE",
            "50 High Street|Oxford|OX1 4AN",
            "15 Market Square|Cambridge|CB2 3NY",
            "75 George Street|Edinburgh|EH2 3ES",
            "32 King Street|Bristol|BS1 4DZ",
            "18 Castle Street|Liverpool|L2 0NE",
            "60 Church Lane|Manchester|M9 5BG",
            "7 Abbey Road|Birmingham|B29 7SN",
            "14 Elm Street|Glasgow|G1 2NG",
            "22 Main Street|Leeds|LS1 4DR",
            "36 Bridge Street|Cardiff|CF10 2GF",
            "12 Victoria Street|Belfast|BT1 3GH",
            "50 Park Road|Sheffield|S10 2TG",
            "8 York Street|Nottingham|NG1 3PS",
            "25 London Road|Leicester|LE2 1ED",
            "11 Princes Street|Edinburgh|EH2 4AD",
            "30 Water Street|Birmingham|B3 1HP",
            "17 Oxford Street|London|W1D 2DH",
            "9 Cambridge Road|Cambridge|CB4 3EL",
            "28 Highfield Road|Leeds|LS6 3HA",
            "43 Crescent Road|Glasgow|G12 8LA",
            "5 Hill Street|Bristol|BS2 8DH",
            "19 Meadow Lane|Manchester|M4 4BB",
            "27 Church Street|Cardiff|CF5 1NB",
            "35 Highgate Road|Birmingham|B12 9BX",
            "21 Chapel Street|Liverpool|L3 9AG",
            "46 West Street|Brighton|BN1 2RS",
            "8 North Road|Newcastle|NE1 4AF",
            "29 South Street|Sheffield|S1 4PR",
            "15 Green Lane|Nottingham|NG2 2GR",
            "12 Kingsway|Cardiff|CF11 9AB",
            "38 Mill Road|Cambridge|CB1 2AW",
            "45 Church Hill|London|E17 3AB",
            "13 Park Avenue|Edinburgh|EH16 5BB",
            "22 High Street|Birmingham|B4 6DS",
            "34 Queen Street|Manchester|M2 5HP",
            "41 Bath Street|Glasgow|G2 4HZ",
            "17 Duke Street|Liverpool|L1 5AA",
            "20 Albert Road|Leeds|LS2 8BA",
            "31 Station Road|Cardiff|CF24 2GA",
            "26 George Street|Edinburgh|EH2 4JL",
            "8 Warwick Road|London|SW1V 1SD",
            "14 Abbey Lane|Sheffield|S8 0BR",
            "23 Hanover Street|Liverpool|L1 3DZ",
            "37 St. John Street|Manchester|M4 1LW",
            "9 Palace Street|Brighton|BN1 1ER",
            "19 Mill Lane|Cambridge|CB2 1RX",
            "12 Richmond Road|Cardiff|CF24 3AS",
            "44 High Street|Birmingham|B6 4LB",
            "5 Church View|Glasgow|G1 4DD",
            "18 Town End|Leeds|LS13 1BR",
            "33 Hilltop Drive|Nottingham|NG5 3FW",
            "10 Albert Terrace|Edinburgh|EH10 5PN",
            "27 Park End|London|W1K 7HW",
            "31 Wood Street|Sheffield|S9 1AL",
            "21 Bridgewater Road|Cardiff|CF3 6RD",
            "36 King Edward Street|Manchester|M3 7BE",
            "9 Wellington Street|Liverpool|L2 2AD",
            "16 Seaforth Road|Glasgow|G12 0AA",
            "22 Market Place|Leeds|LS1 6DP",
            "5 Portland Street|Edinburgh|EH6 4AX",
            "30 Grove Road|London|E3 5TD",
            "11 Church Hill|Birmingham|B11 4BR",
            "39 Oak Street|Nottingham|NG7 4EQ",
            "8 Eastgate|Cambridge|CB5 8AQ",
            "25 Stanley Street|Cardiff|CF10 5BD",
            "17 Victoria Lane|Liverpool|L1 5DW",
            "42 Highfield Avenue|Sheffield|S2 4HE",
            "19 Milton Road|Edinburgh|EH10 7PL",
            "15 Nelson Street|Manchester|M13 9AB",
            "29 Parkfield Road|Leeds|LS11 5PH",
            "6 Westbourne Road|Birmingham|B15 3TG",
            "23 Hillcrest|Bristol|BS5 7JD",
            "41 Woodland Drive|Nottingham|NG9 5BL",
            "18 Woodside Avenue|Cambridge|CB4 2AG",
            "27 Regent Street|Cardiff|CF24 0ST",
            "33 Bath Road|Liverpool|L3 7DA",
            "12 Station Road|Edinburgh|EH12 7AF",
            "20 Alexander Street|London|SW1W 0LS",
            "5 Greenfield Drive|Sheffield|S10 5SL",
            "16 Broad Street|Birmingham|B1 2DJ",
            "39 South Park|Manchester|M14 5GY",
            "24 Springfield Road|Leeds|LS2 9DP",
            "11 Castle Lane|Cardiff|CF10 3ER",
            "28 Clarence Street|Glasgow|G1 3JD",
            "7 Victoria Street|Liverpool|L2 5QS",
            "30 Oakfield Road|Nottingham|NG8 5GR",
            "22 Railway Terrace|Bristol|BS2 9HR",
            "35 Highgate Avenue|London|N6 5HX",
            "19 Greenfield Street|Sheffield|S5 8GT",
            "12 Hill Lane|Birmingham|B5 7PS",
            "44 Kingsmead|Cambridge|CB1 3DF",
            "22 Forest Rd W|Nottingham|NG7 4EQ",
            "16 Waverley St|Nottingham|NG7 4DY",
            "20 Forest Rd E|Nottingham|NG1 4HH",
            "62 Wellington Street|Leicester|LE1 6AR",
            "48 Park Lane|London|W1K 1QA",
            "16 Rose Avenue|Oxford|OX2 6UX",
            "27 Market Street|Cambridge|CB2 1RB",
            "50 Regent Street|Edinburgh|EH1 2QF",
            "35 Victoria Road|Brighton|BN1 2AA",
            "8 King Edward Street|Liverpool|L2 8TZ",
            "11 Church Street|Birmingham|B5 6DT",
            "24 Duke Street|Glasgow|G11 6HR",
            "38 Oxford Street|Leeds|LS1 5AE",
            "15 Bridge Street|Cardiff|CF10 1QL",
            "9 Victoria Square|Belfast|BT1 4GY",
            "32 Park Road|Sheffield|S10 1WR",
            "25 King Street|Leicester|LE2 1PT",
            "12 Castle Street|Edinburgh|EH2 3EE",
            "31 Water Lane|Birmingham|B1 2AH",
            "19 Oxford Road|London|W1D 3DN",
            "13 Cambridge Avenue|Cambridge|CB1 3DZ",
            "26 Highfield Lane|Leeds|LS6 4JD",
            "45 Crescent Lane|Glasgow|G12 0LS",
            "8 Hilltop Street|Bristol|BS1 6UJ",
            "23 Meadow Road|Manchester|M4 5BH",
            "35 Church Street|Cardiff|CF11 1JA",
            "47 Highgate Avenue|Birmingham|B12 8JL",
            "21 Chapel Lane|Liverpool|L3 9BG",
            "46 West Lane|Brighton|BN1 2ST",
            "10 North Road|Newcastle|NE1 5AF",
            "32 South Lane|Sheffield|S1 5PR",
            "18 Green Lane|Nottingham|NG3 3GR",
            "14 Kingsway|Cardiff|CF11 9AD",
            "37 Mill Lane|Cambridge|CB1 3AX",
            "52 Church Hill|London|E17 4AB",
            "17 Park Avenue|Edinburgh|EH10 5BB",
            "24 High Street|Birmingham|B4 7DS",
            "36 Queen Street|Manchester|M3 6HP",
            "43 Bath Street|Glasgow|G2 5HZ",
            "19 Duke Street|Liverpool|L1 6AA",
            "22 Albert Road|Leeds|LS2 9BA",
            "9 Victoria Road|Brighton|BN1 3GF",
            "28 Station Road|Cardiff|CF24 3GA",
            "20 George Street|Edinburgh|EH2 4LJ",
            "11 Warwick Road|London|SW1V 2SD",
            "13 Abbey Lane|Sheffield|S8 1BR",
            "26 Hanover Street|Liverpool|L1 3DZ",
            "37 St. John Street|Manchester|M4 2LW",
            "14 Palace Street|Brighton|BN1 2ER",
            "23 Mill Lane|Cambridge|CB2 2RX",
            "15 Richmond Road|Cardiff|CF24 4AS",
            "42 High Street|Birmingham|B6 5LB",
            "7 Church View|Glasgow|G1 5DD",
            "20 Town End|Leeds|LS13 2BR",
            "35 Hilltop Drive|Nottingham|NG5 4FW",
            "11 Albert Terrace|Edinburgh|EH10 6PN",
            "28 Park End|London|W1K 8HW",
            "31 Wood Street|Sheffield|S9 2AL",
            "21 Bridgewater Road|Cardiff|CF3 7RD",
            "34 King Edward Street|Manchester|M3 8BE",
            "10 Wellington Street|Liverpool|L2 3AD",
            "17 Seaforth Road|Glasgow|G12 1AA",
            "22 Market Place|Leeds|LS1 7DP",
            "7 Portland Street|Edinburgh|EH6 5AX",
            "30 Grove Road|London|E3 6TD",
            "11 Church Hill|Birmingham|B11 5BR",
            "39 Oak Street|Nottingham|NG7 5EQ",
            "8 Eastgate|Cambridge|CB5 9AQ",
            "25 Stanley Street|Cardiff|CF10 6BD",
            "18 Victoria Lane|Liverpool|L1 6DW",
            "42 Highfield Avenue|Sheffield|S2 5HE",
            "19 Milton Road|Edinburgh|EH10 8PL",
            "15 Nelson Street|Manchester|M13 10AB",
            "29 Parkfield Road|Leeds|LS11 6PH",
            "6 Westbourne Road|Birmingham|B15 4TG",
            "23 Hillcrest|Bristol|BS5 8JD",
            "41 Woodland Drive|Nottingham|NG9 6BL",
            "18 Woodside Avenue|Cambridge|CB4 3AG",
            "27 Regent Street|Cardiff|CF24 1ST",
            "33 Bath Road|Liverpool|L3 8DA"
        };
        public static Faker<Add> addressFaker = new Faker<Add>("en_GB")
            .RuleFor(a => a.StreetAddress, f => f.Address.StreetAddress())
            .RuleFor(a => a.City, f => f.Address.City()) // 这里你可以使用 faker 生成随机城市
            .RuleFor(a => a.PostalCode, f => f.Address.ZipCode());

        public static Random random = new Random();
        public static string RadomAdd()
        {
            return adds[random.Next(adds.Length)];
        }


        public static void Random(JObject account)
        {
            var addrInfo = UKAdd.RadomAdd().Split('|');
            account["sta"] = addrInfo[0];
            account["pt"] = addrInfo[1];
            account["pc"] = addrInfo[2];
        }

        public class Add
        {
            public string StreetAddress { get; set; }
            public string City { get; set; }
            public string PostalCode { get; set; }
        }
    }
}
